package com.skivingcloud.common.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class JacksonUtil {

    /**
     * 将json字符串转换为map
     * @param json json字符串
     * @return map
     */
    public static Map<String, String> jsonStringToMap(String json) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, new TypeReference<>() {
        });
    }

    /**
     * 将json字符串转换为map
     * @param json json字符串
     * @return map
     */
    public static Map<String, Object> jsonToMap(String json) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, new TypeReference<>() {
        });
    }

    /**
     * 将map转为json字符串
     * @param map map对象
     * @return json串
     */
    public static String mapToJsonString(Map<String, Object> map) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.writeValueAsString(map);
    }

    public static String objectToJsonString(Object obj) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.writeValueAsString(obj);
    }

    public static List<Map<String, Object>> jsonToListMap(String json) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        // 将JSON字符串转换为List对象
        return mapper.readValue(json, new TypeReference<List<Map<String, Object>>>() {});
    }

    public static void main(String[] args) {
        String json = "{\n" +
                "  \"widgetList\": [\n" +
                "    {\n" +
                "      \"type\": \"static-text\",\n" +
                "      \"icon\": \"static-text\",\n" +
                "      \"formItemFlag\": false,\n" +
                "      \"options\": {\n" +
                "        \"name\": \"statictext111193\",\n" +
                "        \"columnWidth\": \"200px\",\n" +
                "        \"hidden\": false,\n" +
                "        \"textContent\": \"主从表单\",\n" +
                "        \"customClass\": [],\n" +
                "        \"onCreated\": \"\",\n" +
                "        \"onMounted\": \"\",\n" +
                "        \"label\": \"static-text\"\n" +
                "      },\n" +
                "      \"id\": \"statictext111193\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"divider\",\n" +
                "      \"icon\": \"divider\",\n" +
                "      \"formItemFlag\": false,\n" +
                "      \"options\": {\n" +
                "        \"name\": \"divider102346\",\n" +
                "        \"label\": \"\",\n" +
                "        \"columnWidth\": \"200px\",\n" +
                "        \"direction\": \"horizontal\",\n" +
                "        \"contentPosition\": \"center\",\n" +
                "        \"hidden\": false,\n" +
                "        \"customClass\": [],\n" +
                "        \"onCreated\": \"\",\n" +
                "        \"onMounted\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"divider102346\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"input\",\n" +
                "              \"icon\": \"text-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"input101987\",\n" +
                "                \"label\": \"订单编号\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"type\": \"text\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"readonly\": true,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"showPassword\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"minLength\": null,\n" +
                "                \"maxLength\": null,\n" +
                "                \"showWordLimit\": false,\n" +
                "                \"prefixIcon\": \"\",\n" +
                "                \"suffixIcon\": \"\",\n" +
                "                \"appendButton\": false,\n" +
                "                \"appendButtonDisabled\": false,\n" +
                "                \"buttonIcon\": \"el-icon-search\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onInput\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"input101987\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol78314\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-78314\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol38113\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-38113\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid109613\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid109613\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"input\",\n" +
                "              \"icon\": \"text-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"input95851\",\n" +
                "                \"label\": \"购买客户\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"type\": \"text\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"readonly\": true,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"showPassword\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": [],\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"minLength\": null,\n" +
                "                \"maxLength\": null,\n" +
                "                \"showWordLimit\": false,\n" +
                "                \"prefixIcon\": \"\",\n" +
                "                \"suffixIcon\": \"\",\n" +
                "                \"appendButton\": true,\n" +
                "                \"appendButtonDisabled\": false,\n" +
                "                \"buttonIcon\": \"el-icon-search\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onInput\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"input95851\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol9704\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-9704\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"date\",\n" +
                "              \"icon\": \"date-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"date75919\",\n" +
                "                \"label\": \"下单日期\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"type\": \"date\",\n" +
                "                \"defaultValue\": null,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"readonly\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"editable\": false,\n" +
                "                \"format\": \"yyyy-MM-dd\",\n" +
                "                \"valueFormat\": \"yyyy-MM-dd\",\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"date75919\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol67512\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-67512\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid63405\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid63405\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"select\",\n" +
                "              \"icon\": \"select-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"select71837\",\n" +
                "                \"label\": \"支付方式\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"filterable\": false,\n" +
                "                \"allowCreate\": false,\n" +
                "                \"remote\": false,\n" +
                "                \"automaticDropdown\": false,\n" +
                "                \"multiple\": false,\n" +
                "                \"multipleLimit\": 0,\n" +
                "                \"optionItems\": [\n" +
                "                  {\n" +
                "                    \"value\": \"1\",\n" +
                "                    \"label\": \"微信\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"2\",\n" +
                "                    \"label\": \"支付宝\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"3\",\n" +
                "                    \"label\": \"其他\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onRemoteQuery\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"select71837\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol18846\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-18846\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"switch\",\n" +
                "              \"icon\": \"switch-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"switch35050\",\n" +
                "                \"label\": \"是否需要发票\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": false,\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"switchWidth\": 40,\n" +
                "                \"activeText\": \"需要\",\n" +
                "                \"inactiveText\": \"不需要\",\n" +
                "                \"activeColor\": null,\n" +
                "                \"inactiveColor\": null,\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"switch35050\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol74079\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-74079\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid82940\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid82940\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"select\",\n" +
                "              \"icon\": \"select-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"select78072\",\n" +
                "                \"label\": \"物流快递\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"filterable\": false,\n" +
                "                \"allowCreate\": false,\n" +
                "                \"remote\": false,\n" +
                "                \"automaticDropdown\": false,\n" +
                "                \"multiple\": false,\n" +
                "                \"multipleLimit\": 0,\n" +
                "                \"optionItems\": [\n" +
                "                  {\n" +
                "                    \"value\": \"1\",\n" +
                "                    \"label\": \"中国邮政\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"2\",\n" +
                "                    \"label\": \"顺丰\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"3\",\n" +
                "                    \"label\": \"申通\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"4\",\n" +
                "                    \"label\": \"中通\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"5\",\n" +
                "                    \"label\": \"韵达\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onRemoteQuery\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"select78072\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol14757\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-14757\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid49116\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid49116\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"input\",\n" +
                "              \"icon\": \"text-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"input20247\",\n" +
                "                \"label\": \"收货地址\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"type\": \"text\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"readonly\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"showPassword\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"minLength\": null,\n" +
                "                \"maxLength\": null,\n" +
                "                \"showWordLimit\": false,\n" +
                "                \"prefixIcon\": \"\",\n" +
                "                \"suffixIcon\": \"\",\n" +
                "                \"appendButton\": false,\n" +
                "                \"appendButtonDisabled\": false,\n" +
                "                \"buttonIcon\": \"el-icon-search\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onInput\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"input20247\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol10575\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 24,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-10575\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid30617\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid30617\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"card\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"card\",\n" +
                "      \"widgetList\": [\n" +
                "        {\n" +
                "          \"type\": \"sub-form\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"sub-form\",\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"select\",\n" +
                "              \"icon\": \"select-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"select27919\",\n" +
                "                \"label\": \"购买产品\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"filterable\": false,\n" +
                "                \"allowCreate\": false,\n" +
                "                \"remote\": false,\n" +
                "                \"automaticDropdown\": false,\n" +
                "                \"multiple\": false,\n" +
                "                \"multipleLimit\": 0,\n" +
                "                \"optionItems\": [\n" +
                "                  {\n" +
                "                    \"value\": \"p1\",\n" +
                "                    \"label\": \"苹果\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"p2\",\n" +
                "                    \"label\": \"菠萝\"\n" +
                "                  },\n" +
                "                  {\n" +
                "                    \"value\": \"p3\",\n" +
                "                    \"label\": \"荔枝\"\n" +
                "                  }\n" +
                "                ],\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onRemoteQuery\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"select27919\"\n" +
                "            },\n" +
                "            {\n" +
                "              \"type\": \"input\",\n" +
                "              \"icon\": \"text-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"input37637\",\n" +
                "                \"label\": \"型号/规格\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"type\": \"text\",\n" +
                "                \"defaultValue\": \"\",\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"150px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"readonly\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"clearable\": true,\n" +
                "                \"showPassword\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"minLength\": null,\n" +
                "                \"maxLength\": null,\n" +
                "                \"showWordLimit\": false,\n" +
                "                \"prefixIcon\": \"\",\n" +
                "                \"suffixIcon\": \"\",\n" +
                "                \"appendButton\": false,\n" +
                "                \"appendButtonDisabled\": false,\n" +
                "                \"buttonIcon\": \"el-icon-search\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onInput\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"input37637\"\n" +
                "            },\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number36803\",\n" +
                "                \"label\": \"单价\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"150px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 2,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number36803\"\n" +
                "            },\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number10017\",\n" +
                "                \"label\": \"数量\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"150px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 0,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number10017\"\n" +
                "            },\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number9464\",\n" +
                "                \"label\": \"小计金额\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"150px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": true,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 2,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number9464\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"subform27823\",\n" +
                "            \"showBlankRow\": true,\n" +
                "            \"showRowNumber\": true,\n" +
                "            \"labelAlign\": \"label-center-align\",\n" +
                "            \"hidden\": false,\n" +
                "            \"customClass\": \"\",\n" +
                "            \"onSubFormRowAdd\": \"\",\n" +
                "            \"onSubFormRowInsert\": \"\",\n" +
                "            \"onSubFormRowDelete\": \"\",\n" +
                "            \"onSubFormRowChange\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"subform27823\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"card105958\",\n" +
                "        \"label\": \"订单明细\",\n" +
                "        \"hidden\": false,\n" +
                "        \"folded\": false,\n" +
                "        \"showFold\": false,\n" +
                "        \"cardWidth\": \"100%\",\n" +
                "        \"shadow\": \"never\",\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"card105958\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number97501\",\n" +
                "                \"label\": \"累计金额\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": true,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 2,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number97501\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol101404\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-101404\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number88459\",\n" +
                "                \"label\": \"优惠金额\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 2,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number88459\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol42397\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-42397\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid47470\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid47470\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"type\": \"grid\",\n" +
                "      \"category\": \"container\",\n" +
                "      \"icon\": \"grid\",\n" +
                "      \"cols\": [\n" +
                "        {\n" +
                "          \"type\": \"grid-col\",\n" +
                "          \"category\": \"container\",\n" +
                "          \"icon\": \"grid-col\",\n" +
                "          \"internal\": true,\n" +
                "          \"widgetList\": [\n" +
                "            {\n" +
                "              \"type\": \"number\",\n" +
                "              \"icon\": \"number-field\",\n" +
                "              \"formItemFlag\": true,\n" +
                "              \"options\": {\n" +
                "                \"name\": \"number27788\",\n" +
                "                \"label\": \"实付金额\",\n" +
                "                \"labelAlign\": \"\",\n" +
                "                \"defaultValue\": 0,\n" +
                "                \"placeholder\": \"\",\n" +
                "                \"columnWidth\": \"200px\",\n" +
                "                \"size\": \"\",\n" +
                "                \"labelWidth\": null,\n" +
                "                \"labelHidden\": false,\n" +
                "                \"disabled\": false,\n" +
                "                \"hidden\": false,\n" +
                "                \"required\": false,\n" +
                "                \"validation\": \"\",\n" +
                "                \"validationHint\": \"\",\n" +
                "                \"customClass\": \"\",\n" +
                "                \"labelIconClass\": null,\n" +
                "                \"labelIconPosition\": \"rear\",\n" +
                "                \"labelTooltip\": null,\n" +
                "                \"min\": -100000000000,\n" +
                "                \"max\": 100000000000,\n" +
                "                \"precision\": 2,\n" +
                "                \"step\": 1,\n" +
                "                \"controlsPosition\": \"right\",\n" +
                "                \"onCreated\": \"\",\n" +
                "                \"onMounted\": \"\",\n" +
                "                \"onChange\": \"\",\n" +
                "                \"onFocus\": \"\",\n" +
                "                \"onBlur\": \"\",\n" +
                "                \"onValidate\": \"\"\n" +
                "              },\n" +
                "              \"id\": \"number27788\"\n" +
                "            }\n" +
                "          ],\n" +
                "          \"options\": {\n" +
                "            \"name\": \"gridCol71662\",\n" +
                "            \"hidden\": false,\n" +
                "            \"span\": 12,\n" +
                "            \"offset\": 0,\n" +
                "            \"push\": 0,\n" +
                "            \"pull\": 0,\n" +
                "            \"responsive\": false,\n" +
                "            \"md\": 12,\n" +
                "            \"sm\": 12,\n" +
                "            \"xs\": 12,\n" +
                "            \"customClass\": \"\"\n" +
                "          },\n" +
                "          \"id\": \"grid-col-71662\"\n" +
                "        }\n" +
                "      ],\n" +
                "      \"options\": {\n" +
                "        \"name\": \"grid59881\",\n" +
                "        \"hidden\": false,\n" +
                "        \"gutter\": 12,\n" +
                "        \"customClass\": \"\"\n" +
                "      },\n" +
                "      \"id\": \"grid59881\"\n" +
                "    }\n" +
                "  ],\n" +
                "  \"formConfig\": {\n" +
                "    \"modelName\": \"formData\",\n" +
                "    \"refName\": \"vForm\",\n" +
                "    \"rulesName\": \"rules\",\n" +
                "    \"labelWidth\": 150,\n" +
                "    \"labelPosition\": \"left\",\n" +
                "    \"size\": \"\",\n" +
                "    \"labelAlign\": \"label-right-align\",\n" +
                "    \"cssCode\": \"\",\n" +
                "    \"customClass\": [],\n" +
                "    \"functions\": \"\",\n" +
                "    \"layoutType\": \"PC\",\n" +
                "    \"jsonVersion\": 3,\n" +
                "    \"onFormCreated\": \"\",\n" +
                "    \"onFormMounted\": \"\",\n" +
                "    \"onFormDataChange\": \"\",\n" +
                "    \"onFormValidate\": \"\"\n" +
                "  }\n" +
                "}";
        try {
            JsonNode jsonNode = new ObjectMapper().readTree(json);
            List<AllCws> result = new ArrayList<>();
            testJsonNode(jsonNode.get("widgetList"), result);
            System.out.println(objectToJsonString(result));
            List<JsonNode> subFormCws = new ArrayList<>();
            List<JsonNode> objCws = new ArrayList<>();
            result.forEach(cws -> {
                if ("sub-form".equals(cws.getType()) || "grid-sub-form".equals(cws.getType())) {
                    subFormCws.add(cws.getContainer());
                }else if ("object-group".equals(cws.getType())){
                    objCws.add(cws.getContainer());
                }
            });
            subFormCws.forEach(sf -> {
                if ("grid".equals(sf.get("type").asText())) {
                    sf.get("cols").forEach(col -> {
                        col.get("widgetList").forEach(cw -> {
                            if(cw.get("formItemFlag").asBoolean()){
                                if("input".equals(cw.get("type").asText())){
                                    System.out.println("sub-form-grid:{name=" + cw.get("options").get("name") + ",type=" + cw.get("options").get("type").asText() + ",maxLength=" + (cw.get("options").get("maxLength") == null ? null : cw.get("options").get("maxLength").asText()) + "}");
                                }
                            }
                        });
                    });
                } else if ("table".equals(sf.get("type").asText())) {
                    sf.get("rows").forEach(row -> {
                        row.get("cols").forEach(cell ->{
                            cell.get("widgetList").forEach(cw -> {
                                if(cw.get("formItemFlag").asBoolean()){
                                    if("input".equals(cw.get("type").asText())){
                                        System.out.println("sub-form-table:{name=" + cw.get("options").get("name") + ",type=" + cw.get("options").get("type").asText() + ",maxLength=" + (cw.get("options").get("maxLength") == null ? null : cw.get("options").get("maxLength").asText()) + "}");
                                    }
                                }
                            });
                        });
                    });
                } else if ("tab".equals(sf.get("type").asText())) {
                    sf.get("tab").forEach(tab -> {
                        tab.get("widgetList").forEach(cw -> {
                            if(cw.get("formItemFlag").asBoolean()){
                                if("input".equals(cw.get("type").asText())){
                                    System.out.println("sub-form-table:{name=" + cw.get("options").get("name") + ",type=" + cw.get("options").get("type").asText() + ",maxLength=" + (cw.get("options").get("maxLength") == null ? null : cw.get("options").get("maxLength").asText()) + "}");
                                }
                            }
                        });
                    });
                }
            });
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }

    }

    public static void testJsonNode(JsonNode jsonNode, List<AllCws> result) {
        jsonNode.forEach(m -> {
            if (m.has("category") && "container".equals(m.get("category").asText())) {
                if ("vf-dialog".equals(m.get("type").asText()) || "vf-drawer".equals(m.get("type").asText())) {
                    //什么也不做
                } else {
                    AllCws cws = new AllCws();
                    cws.setName(m.get("options").get("name").asText());
                    cws.setType(m.get("type").asText());
                    cws.setContainer(m);
                    result.add(cws);
                }
            }
            if ("grid".equals(m.get("type").asText())) {
                m.get("cols").forEach(col -> {
                    testJsonNode(col.get("widgetList"), result);
                });
            } else if ("table".equals(m.get("type").asText())) {
                m.get("rows").forEach(row -> {
                    row.get("cols").forEach(col -> {
                        testJsonNode(col.get("widgetList"), result);
                    });
                });
            } else if ("tab".equals(m.get("type").asText())) {
                m.get("tabs").forEach(tab -> {
                    testJsonNode(tab.get("widgetList"), result);
                });
            } else if ("sub-form".equals(m.get("type").asText()) || "grid-sub-form".equals(m.get("type").asText())) {
                testJsonNode(m.get("widgetList"), result);
            } else if (m.has("category") && "container".equals(m.get("category").asText())) {
                if ("vf-dialog".equals(m.get("type").asText()) || "vf-drawer".equals(m.get("type").asText())) {
                    //什么也不做
                } else {
                    testJsonNode(m.get("widgetList"), result);
                }
            }
        });
    }
}
